
import Vue from "vue"
import Vuex from "vuex"

import createPersistedState from "vuex-persistedstate"
Vue.use(Vuex)


const  store = new Vuex.Store({
    plugins: [createPersistedState()],
    state:{
        appphone:null,
        userinfo:null,
        cityinfo:null
    },
    mutations:{
        changeAppPhone(state,payload){
            state.appphone = payload
        },
        changeUserInfo(state,payload){
            state.userinfo = {
                ...state.userinfo,
                ...payload
            }
        },
        resetUserInfo(state){
            state.userinfo = null
        },
        changeCityInfo(state,payload){
            state.cityinfo = payload
        }
    },
    modules:{},
    actions:{}
})

export default store;